<!-- 举报列表 -->

<!-- 项目管理 -->
<template>
  <div class="page-box h100 display-flex czbj">
    <p class="title-label mb10">举报列表</p>
    <!-- sonRouter="yybureauFormationBJ" 为跳转新的页面编辑 -->
    <dxtable
      :dataJson="dataJson"
      :portUrl="portUrl"
      :formJson="formJson"
      :qx="qx"
      ref="databale"
    ></dxtable>
  </div>
</template>
<script lang="ts" setup>
import { Options } from "@vicons/ionicons5";
import dxtable from "../../components/util/dxtable.vue";
import sort from "../../components/util/sort.vue";
import { dxget, dxpost } from "../../util/index";
import { NButton, NImage, NTag } from "naive-ui";
import { h, ref, reactive } from "vue";
const databale = ref();
const initeer = () => {
  databale.value.initDataExpose();
};
let dataJson = [
  {
    title: "举报人头像",
    type: "img",
    val: "",
    icon: "dx-img",
    span: 12,
    key: "headPortrait",
    width: "100",
    search: false,
    istable: true,
    required: false,
  },
  {
    title: "举报人手机号码",
    type: "input",
    val: "",
    icon: "dx-shurukuang",
    span: 12,
    key: "phone",
    width: "150",
    search: false,
    istable: true,
    required: false,
  },
  {
    title: "举报类型",
    width: 100,
    type: "select",
    options: [
      {
        label: "全部",
        value: "",
      },
      {
        label: "项目",
        value: "1",
      },
      {
        label: "资源",
        value: "2",
      },
    ],
    key: "type",
    search: true,
    render: (row) => {
      if (row.type == 1) {
        return "项目";
      }
      if (row.type == 2) {
        return "资源";
      }
    },
  },
  {
    title: "名称",
    key: "mingcheng",
    width: "",
    search: false,
    istable: true,
    required: false,
  },
  {
    title: "原因",
    type: "input",
    val: "",
    icon: "dx-shurukuang",
    span: 12,
    key: "yuanying",
    width: "",
    search: false,
    istable: true,
    required: false,
  },
  {
    title: "详情描述",
    type: "input",
    val: "",
    icon: "dx-shurukuang",
    span: 12,
    key: "xqms",
    width: "",
    search: false,
    istable: true,
    required: false,
  },
  {
    title: "截图证据",
    type: "imglist",
    val: [],
    key: "jtzj",
  },
  {
    title: "排序",
    width: 100,
    render: (row) => {
      row.sjk = "xtgx"; //数据库
      row.databaseName = "keyEnterprise"; //表名
      return h(sort, {
        row,
        onCallBack: () => {
          initeer();
        },
      });
    },
  },
  {
    title: "添加时间",
    key: "addTime",
    width: 150,
  },
];

const qx = {
  DeletePermissionID: "jchreportdel", //删除
  EditPermissionIdentifier: "jchreportbj22", // 编辑
  NewPermissionIdentifier: "jchreportxz222", // 新建
  ViewPermissionID: "jchreportck", // 查看
};
const portUrl = "jiacaihui/report";

let formJson = reactive([
  {
    title: "原因",
    type: "input",
    val: "",
    icon: "dx-shurukuang",
    span: 12,
    key: "yuanying",
    width: "",
    search: false,
    istable: true,
    required: false,
  },
  {
    title: "详情描述",
    type: "input",
    val: "",
    icon: "dx-shurukuang",
    span: 12,
    key: "xqms",
    width: "",
    search: false,
    istable: true,
    required: false,
  },
  {
    title: "截图证据",
    type: "imglist",
    val: [],
    icon: "dx-ai-img-list",
    span: 12,
    key: "jtzj",
    width: "",
    search: false,
    istable: true,
    required: false,
  },
]);
const czFun = {
  fun: (row) => {
    return [
      h(
        NButton,
        {
          type: "info",
          quaternary: true,
          onClick: async (e) => {},
        },
        "复制代码"
      ),
    ];
  },
};

// 获取字典内容
// const xtgxxmfl = async () => {
//   const { data }: any = await dxget("dxgjAdmin/getzd", { name: 'xtgxxmfl' })
//   dataJson[2].options = [
//     {
//       label: "全部",
//       value: ""
//     },
//     ...data
//   ]
//   formJson[2].options = data
//   xmlxSelect.value = data
//   console.log(data);
// }
// xtgxxmfl()
</script>
<style scoped></style>
